<template>
  <div class="home">
    <c1 />
    <hr>
    <button @click="fn1">点我一下</button>
  </div>
</template>

// 这是vue3.0

<script>

import c1 from '@/components/c1.vue'
import { provide, ref } from 'vue'

export default {
  name: 'Home',
  components: {
    c1
  },
  setup () {
    const location = ref('上海滩')
    provide('address', location)
    const fn1 = () => {
      location.value = '广州'
    }

    return {
      fn1
    }
  }
}
</script>
